﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Quickuse.Logging
{

    internal class Utily
    {
        /// <summary>
        /// 获取索引名
        /// </summary>
        /// <param name="values"></param>
        /// <returns></returns>
        internal static string GetIndexName(string[] values)
        {
            List<string> valueArray = new List<string>();
            foreach (var value in values)
            {
                //是否包含成对的中括号
                if (value.IndexOf("[") == 0 && value.IndexOf("]") == (value.Length - 1))
                {
                    switch (value.ToLower())
                    {
                        case "[level]":

                            break;
                        default:
                            valueArray.Add(DateTime.Now.ToString(value.Replace("[", "").Replace("]", "")));
                            break;
                    }
                }
                else
                {
                    valueArray.Add(value);
                }
            }

            return string.Join("-", valueArray);
        }
    }
}
